<template>
  <div>
    <!-- <hear></hear> -->
    <div>
      <div class="Guarantee_status_box">
        <el-row class="mb8">
          <el-col :span="19">
            <el-button
              type="info"
              @click="shuaxin"
              icon="el-icon-refresh-right"
            ></el-button>
            <!-- <el-button type="success" @click="handleAdd" icon="el-icon-plus">上传</el-button> -->
          </el-col>
          <el-col :span="5" class="seach">
            <el-input
              v-model="params.keywords"
              placeholder="请输入文件名称"
            ></el-input>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="shuaxin"
            ></el-button>
          </el-col>
        </el-row>

        <div class="shenflex">
          <el-table
            ref="multipleTable"
            :data="tableData"
            tooltip-effect="dark"
            height="250"
            class="table xinde"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column
              prop="id"
              align="center"
              label="序号"
              @click="details"
              width="50"
            ></el-table-column>
            <el-table-column
              prop="projectId"
              align="center"
              :show-overflow-tooltip="true"
              width="220"
              label="项目编号"
            ></el-table-column>
            <el-table-column
              prop="packageNumber"
              :show-overflow-tooltip="true"
              width="220"
              align="center"
              label="包号"
            ></el-table-column>
            <el-table-column
              prop="projectName"
              :show-overflow-tooltip="true"
              width="220"
              align="center"
              label="项目名称"
            ></el-table-column>
            <el-table-column
              prop="procurementMethod"
              align="center"
              :show-overflow-tooltip="true"
              width="220"
              label="采购方式"
            ></el-table-column>
            <el-table-column
              align="center"
              :show-overflow-tooltip="true"
              width="220"
              label="开标日期"
            >
              <template slot-scope="scope">
                <span v-show="scope.row.bidOpeningTime == null"></span>
                <span v-show="scope.row.bidOpeningTime != null">{{
                  scope.row.bidOpeningTime
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :show-overflow-tooltip="true"
              width="220"
              align="center"
              label="截止日期"
            >
              <template slot-scope="scope">
                <span v-show="scope.row.tenderEndTime == null"></span>
                <span v-show="scope.row.tenderEndTime != null">{{
                  scope.row.tenderEndTime
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :show-overflow-tooltip="true"
              width="220"
              prop="purchaseDemand"
              align="center"
              label="采购需求内容"
            ></el-table-column>
            <el-table-column
              :show-overflow-tooltip="true"
              width="220"
              prop="money"
              align="center"
              label="预算金额"
            ></el-table-column>
            <el-table-column
              prop="term"
              align="center"
              :show-overflow-tooltip="true"
              width="160"
              label="合同履行期限"
            ></el-table-column>
            <el-table-column
              prop="qualification"
              :show-overflow-tooltip="true"
              width="200"
              align="center"
              label="申请人资格要求"
            >
              <!-- <template slot-scope="scope">
            {{scope.row.moneysource==0?'政府资金':scope.row.moneysource==1?'自筹资金':'其他自己资金'}}
        </template> -->
            </el-table-column>
            <el-table-column
              prop="scope"
              :show-overflow-tooltip="true"
              width="120"
              fixed="right"
              align="center"
              label="操作"
            >
              <template slot-scope="scope">
                <el-button type="text" @click="details(scope.row)" size="small"
                  >查看详情</el-button
                >
              </template>
            </el-table-column>
            <!-- <el-table-column
              fixed="right"
              align="center"
              width="120"
              label="当前进度"
            >
              <template slot-scope="scope">
                <el-button size="mini" @click="handlesc(scope.row)">{{
                 查看详情
                }}</el-button>
              </template>
            </el-table-column> -->
          </el-table>
        </div>
      </div>

      <div class="block">
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentpage"
          :page-sizes="[10, 20, 30]"
          layout="total, sizes, prev, pager, next, jumper"
          :total="pageSize"
        ></el-pagination>
      </div>
    </div>
    <el-dialog :title="title" :visible.sync="open1" width="60%" append-to-body>
      <el-form
        :disabled="true"
        :model="formData"
        :rules="rules"
        label-width="130px"
      >
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="项目编号:">
              <el-input
                v-model="formData.project_id"
                placeholder="请输入项目编号:"
                show-word-pageSize
                clearable
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item
              label-width="130px"
              label="采购项目名称："
              prop="project_name"
            >
              <el-input
                v-model="formData.project_name"
                placeholder="请输入采购项目名称："
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item
              label-width="130px"
              label="采购方式："
              prop="procurement_method"
            >
              <el-input
                v-model="formData.procurement_method"
                placeholder="请输入采购方式："
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label-width="130px" label="预算金额：" prop="money">
              <el-input
                v-model="formData.money"
                placeholder="请输入预算金额："
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item
              label-width="130px"
              label="包号："
              prop="package_number"
            >
              <el-input
                v-model="formData.package_number"
                placeholder="请输入包号："
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item
              label-width="130px"
              label="包名称："
              prop="package_name"
            >
              <el-input
                v-model="formData.package_name"
                placeholder="请输入包名称："
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item
              label-width="130px"
              label="项目联系人："
              prop="field118"
            >
              <el-input
                v-model="formData.field118"
                placeholder="请输入项目联系人："
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item
              label-width="130px"
              label="项目联系方式："
              prop="field119"
            >
              <el-input
                v-model="formData.field119"
                placeholder="请输入项目联系方式："
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div class="bottom">
        <el-tabs type="border-card">
          <el-tab-pane>
            <span slot="label">采购需求</span>
            {{ formData.purchase_demand }}
          </el-tab-pane>
          <el-tab-pane label="申请人资格需求">{{
            formData.qualification
          }}</el-tab-pane>
          <el-tab-pane label="时间地点">
            <p>开标时间:{{ formData.bid_opening_time }}</p>
            <p>开标地点:{{ formData.bid_opening_addr }}</p>
          </el-tab-pane>
          <el-tab-pane label="采购人资料">
            <el-row :gutter="15">
              <el-form
                :disabled="true"
                ref="elForm"
                :model="formData"
                :rules="rules"
                size="medium"
                label-width="100px"
              >
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购人名称："
                    prop="purchase_person_name"
                  >
                    <el-input
                      v-model="formData.purchase_person_name"
                      placeholder="请输入采购人名称："
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购人地址:"
                    prop="purchase_person_addr"
                  >
                    <el-input
                      v-model="formData.purchase_person_addr"
                      placeholder="请输入采购人地址:"
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购人联系人："
                    prop="purchase_person_contact_name"
                  >
                    <el-input
                      v-model="formData.purchase_person_contact_name"
                      placeholder="请输入采购人联系人："
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购人联系方式："
                    prop="purchase_person_contact_mobile"
                  >
                    <el-input
                      v-model="formData.purchase_person_contact_mobile"
                      placeholder="请输入采购人联系方式："
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购代理机构名称："
                    prop="purchase_agent_name"
                  >
                    <el-input
                      v-model="formData.purchase_agent_name"
                      placeholder="请输入采购代理机构名称："
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购代理机构地址："
                    prop="purchase_agent_addr"
                  >
                    <el-input
                      v-model="formData.purchase_agent_addr"
                      placeholder="请输入采购代理机构地址："
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购代理机构联系人："
                    prop="purchase_agent_person"
                  >
                    <el-input
                      v-model="formData.purchase_agent_person"
                      placeholder="请输入采购代理机构联系人："
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label-width="180px"
                    label="采购代理机构联系方式："
                    prop="purchase_agent_mobile"
                  >
                    <el-input
                      v-model="formData.purchase_agent_mobile"
                      placeholder="请输入采购代理机构联系方式："
                      clearable
                      :style="{ width: '100%' }"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-form>
            </el-row>
          </el-tab-pane>
        </el-tabs>
      </div>
    </el-dialog>
  </div>
</template>

<script>
// import { bhlist } from "@/api/system/liucheng";
import { daishen } from "@/api/system/liucheng";
import { yaoqing } from "@/api/purchase";
// import hear from ".././../components/hear.vue";
import axios from "axios";
export default {
  components: {
    // hear
  },
  name: "progress",
  data() {
    return {
      currentpage: null,
      activeName: "first",
      params: {
        pageSize: 4,
        pageNum: 1,
        keywords: "",
        user_id: sessionStorage.getItem("user_id"),
      },
      BidingDocumentList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      opens: false,
      params: {
        pageNum: 1,
        pageSize: 10,
        keywords: "",
        gtype: "",
      },
      total: 0,
      pageSize: 0,
      // 表单参数
      // 表单校验
      rules: {},
      options1: [], //选择部门
      options2: [], //选择职位
      btype: [],
      options3: [], //选择小组
      options4: [], //选择小组
      currentPage1: 5,
      currentPage2: 5,
      currentPage3: 5,
      currentPage4: 4,
      tableData: [],
      multipleSelection: [],
      liuch: {
        user_id: sessionStorage.getItem("id"),
        lc_name: "",
        gtype: "",
      },
      buzhl: false,
      buzhilist: [],
      open1: false,
      formData: {},
    };
  },
  mounted() {
    // this.getBhlist();
    this.zhifu();
  },
  methods: {
    handleUpdate(e) {
      // this.reset();
      this.opens = true;
      //   this.title = "修改员工信息";
    },
    handlesc(e) {
      this.$router.push({
        name: "bhxq",
        query: { company_id: e.guarantee_apply_id },
      });
    },
    buzhlist(e) {
      this.buzhl = true;
    },
    zhifu() {
      yaoqing(this.params).then((res) => {
        // console.log("发票列表", res.data.data.total);
        this.pageSize = res.data.total;
        this.tableData = res.data.rows;
        console.log(this.tableData);
        // if (res.data.code == 1) {
        // }
      });
    },
    shuaxin() {
      this.zhifu();
    },
    getBhlist() {
      bhlist(this.params).then((res) => {
        this.BidingDocumentList = res.data.data.rows;
        this.total = res.data.data.total;
      });
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.params.pageSize = val;
      this.zhifu();
    },
    handleCurrentChange(val) {
      this.params.pageNum = parseInt(val - 1) * this.params.pageSize;
      this.currentpage = val;
      this.zhifu();
    },
    details(rows) {
      console.log(rows);
      var bbc = JSON.stringify(rows);
      this.$router.push({ name: "ggxq", query: { params: bbc } });
      //   this.$router.push({name:'ggxq',query:{company_id:rows.guarantee_apply_id}});
      // this.open1 = true;
      // this.formData = rows;
    },
  },
};
</script>
<style>
.shenflex {
  padding-bottom: 0px !important;
}
</style>
<style scoped>
.el-tabs--left .el-tabs__item.is-active {
  background: #fff !important;
  color: #1795ff !important;
}
.masdas {
  margin-top: -9px;
  margin-left: 10px;
}
/* .table{
        height: 76vh;
    margin-top: 10px;
 
} */
html body {
  /* height: 100% !important; */
  /* background-color: #f5f6fa !important; */
}
.block {
  padding: 10px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.state_bh {
  font-size: 18px;
  font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  font-weight: 400;
  color: #1890ff;
  width: 143px;
  height: 47px;
  border-radius: 4px 4px 4px 4px;
  opacity: 1;
  line-height: 47px;
  text-align: center;
  border: 2px solid #1890ff;
}
.shenflex {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* padding: 20px; */
  padding-top: 0px;
  padding-bottom: 0px;
  height: 69vh;
  margin-top: 10px;
  overflow: auto;
}
.status_bg1 {
  width: 85px;
  height: 40px;
  background-color: #ff1818;
  border-bottom-left-radius: 10px;
  position: relative;
  bottom: 87%;
  left: 94%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  font-size: 18px;
}

.status_bg {
  width: 85px;
  height: 40px;
  background-color: #1795ff;
  border-bottom-left-radius: 10px;
  position: relative;
  bottom: 87%;
  left: 94%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  font-size: 18px;
}

.examine_btn {
  width: 143px;
  height: 47px;
  color: #1795ff;
}

.bubble {
  color: #ffffff;
  font-size: 12px;
  width: 94px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 31px;
  margin-left: 20px;
  background-image: url("@/assets/Guarantee/Bubble.png");
}

.Guarantee_details {
  justify-content: space-around;
}

.Ge_box {
  width: 113px;
  height: 33px;
  border-radius: 4px;
  background-color: #1795ff;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  margin-left: 15px;
}

.Guarantee_num {
  width: 219px;
  height: 48px;
  color: #333333;
}

.Guarantee_status_box {
  /* position: relative;
  top: 9%;
  left: 247px; */
}

.Guarantee_status {
  width: 95%;
  height: 162px;
  margin-bottom: 20px;
  background-color: #ffffff;
  box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.16);
}

.Guarantee_examine {
  color: #333333;
  font-size: 24px;
  margin-left: 30px;
  margin-top: 10px;
  font-weight: Bold;
  margin-bottom: 36px;
}

::v-deep .el-table__body-wrapper {
  /* height: 70vh !important; */
  /* margin-top: 10px; */
  overflow: auto !important;
}
</style>
<style scoped></style>
